package com.thf.controller;

import com.thf.model.CompanyModels;
import com.thf.model.NavModels;
import com.thf.model.TopFootModels;
import com.thf.service.CompanyService;
import com.thf.service.NavService;
import com.thf.service.TopFootService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class CompanyController {
    @Resource
    private CompanyService companyService;
    @Resource
    private TopFootService topFootService ;
    @RequestMapping("/company")
    public String findall(Model model){
        List<CompanyModels> companyModels = companyService.list();
        List<TopFootModels> topFootModels = topFootService.list();
        model.addAttribute("companyData",companyModels.get(0));
        model.addAttribute("topFootData",topFootModels);
        return "/company";
    }
}
